﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Poker : MonoBehaviour
{

    public enum PokerType
    {
        PokerType_heart = 0,
        PokerType_club = 1,
        PokerType_diamond = 2,
        PokerType_spade = 3,
    }

    public PokerType _type;
    public int number;

    public List<Text> pokerNums;
    public List<Image> pokerTypes;

    // Use this for initialization
    void Start()
    {
        foreach (var pokerType in pokerTypes)
        {
            if (_type == PokerType.PokerType_club)
            {
                pokerType.sprite = Resources.Load<Sprite>("Sprites/clubs");
            }
            else if (_type == PokerType.PokerType_diamond)
            {
                pokerType.sprite = Resources.Load<Sprite>("Sprites/diamonds");
            }
            else if (_type == PokerType.PokerType_heart)
            {
                pokerType.sprite = Resources.Load<Sprite>("Sprites/hearts");
            }
            else if (_type == PokerType.PokerType_spade)
            {
                pokerType.sprite = Resources.Load<Sprite>("Sprites/spades");
            }
        }
        string[] NumStr = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
        foreach (var pokerNum in pokerNums) {
            pokerNum.text = NumStr[number - 1];
            if (_type == PokerType.PokerType_club)
            {
                pokerNum.color = new Color(0, 0, 0);
            }
            else if (_type == PokerType.PokerType_diamond)
            {
                pokerNum.color = new Color(1, 0, 0);
            }
            else if (_type == PokerType.PokerType_heart)
            {
                pokerNum.color = new Color(1, 0, 0);
            }
            else if (_type == PokerType.PokerType_spade)
            {
                pokerNum.color = new Color(0, 0, 0);
            }
        }
    }

    // Update is called once per frame
    void Update()
    {

    }
}
